import Vue from 'vue'
import Router from 'vue-router'

import home from '@/pages/Layout/index'
import login from '@/pages/Login/login'
import error from '@/components/Error'

Vue.use(Router)

export const constantRoutes = [
  {
    path: '/login',
    name: 'login',
    component: login
  }  
]

export default new Router({
  routes: constantRoutes
});

// 需要判断权限的路由
export const DynamicRoutes  = [
  {
    path: '/',
    name: 'home',
    component: home,
    children: []
  },
  {
    path: '/error',
    name: 'error',
    component: error      
  }     
]

export const createRouter = routes => new Router({
  routes
});

